package cn.net.yato.picture.controller.backstage;

import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
 
public class Combine {
 
    public static void main(String[] args) {
 
        String[] arr1 = {"a", "b", "c", "d", "e", "f"};
        List<String> listA = new ArrayList<>(Arrays.asList(arr1));
 
        String[] arr2 = {"d", "e", "f", "g", "h"};
        List<String> listB = new ArrayList<>(Arrays.asList(arr2));

        String[] arr3 = {"d", "e", "f", "g", "h","i"};
        List<String> listC = new ArrayList<>(Arrays.asList(arr3));
 
        Set<String> set = new HashSet<>(listA);
        set.addAll(listB);
        set.addAll(listC);
        List<String> list = new ArrayList<>(set);
        System.out.println(list);
        List<String> collect = Stream.of(listA, listB,listC)
                .flatMap(Collection::stream)
                .distinct()
                .collect(Collectors.toList());
        System.out.println(collect);
    }
 
}